package com.example.supplychainbackend.mapper;
import com.example.supplychainbackend.controller.dto.sales.*;
import com.example.supplychainbackend.entity.sales.*;
import org.mapstruct.Builder;
import org.mapstruct.Mapper;
import org.mapstruct.NullValuePropertyMappingStrategy;

import java.util.List;

@Mapper(componentModel = "spring",
        builder = @Builder(disableBuilder = true),
        nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
public interface SalesMapper {

    CustomerDto toCustomerDto(CustomerEntity entity);
    PaymentInfoDto toPaymentDto(CustomerPaymentEntity entity);
    InvoiceInfoDto toInvoiceDto(CustomerInvoiceEntity entity);
    CustomerDetailDto toDetailDto(CustomerEntity entity);
    ContractDto toContractDto(ContractEntity entity);
    List<ContractDto> toContractDtoList(List<ContractEntity> entities);
    DeliverableDto toDeliverableDto(DeliverableEntity entity);

    CustomerEntity toCustomerEntity(CustomerDetailDto dto);
    CustomerPaymentEntity toPaymentEntity(PaymentInfoDto dto);
    CustomerInvoiceEntity toInvoiceEntity(InvoiceInfoDto dto);
    ContractEntity toContractEntity(ContractDto dto);
    DeliverableEntity toDeliverableEntity(DeliverableDto dto);

    OrderDetailDto toOrderDetailDto(OrderEntity orderEntity);
    List<OrderDetailDto> toOrderDetailDtoList(List<OrderEntity> list);
    OrderEntity toOrderEntity(OrderDetailDto orderDetailDto);
    SalesInfoEntity toSalesInfoEntity(SalesInfoDto salesInfoDto);
}
